Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(workflows): add helper and workflow to keep keystone and nautobot in sync #242

Merged
merged 5 commits into from
Sep 10, 2024

Conversation

cardoe
Copy link
Contributor

@cardoe cardoe commented Aug 28, 2024

Adds a helper and a workflow to keep keystone and nautobot in sync. The workflow uses the argoworkflow service account to add, update, and delete tenant's from Nautobot based on the same operations happening in keystone.

@cardoe
Copy link
Contributor Author

cardoe commented Aug 28, 2024

I'm really not a fan of my approach with the tests. Maybe even the whole thing. Would be happy for some feedback on changes. @rackerlabs/understack-dev

@cardoe
Copy link
Contributor Author

cardoe commented Aug 28, 2024

The requests-mock might not be catching all HTTP calls because it feels slow.

Copy link

github-actions bot commented Aug 28, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
314 213 68% 0% 🟢

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: 54c91a4 by action🐍

@skrobul
Copy link
Collaborator

skrobul commented Aug 29, 2024

The requests-mock might not be catching all HTTP calls because it feels slow.

https://vcrpy.readthedocs.io/en/latest/ ?

@cardoe cardoe force-pushed the keystone-event branch 4 times, most recently from 29045c2 to ba2905e Compare September 3, 2024 18:45
@cardoe
Copy link
Contributor Author

cardoe commented Sep 3, 2024

So need some ideas on how to better check the workflow template against the schema. Otherwise I think this will work.

@cardoe cardoe force-pushed the keystone-event branch 2 times, most recently from 1e888dd to 54c91a4 Compare September 3, 2024 21:26
@cardoe cardoe marked this pull request as ready for review September 4, 2024 11:56
@cardoe cardoe requested a review from a team September 4, 2024 11:56
@cardoe cardoe force-pushed the keystone-event branch 14 times, most recently from 0e9ba93 to 3772008 Compare September 6, 2024 14:11
@cardoe cardoe removed the request for review from skrobul September 6, 2024 14:28
@cardoe cardoe removed the request for review from mfencik September 6, 2024 14:28
Added a helper script to sync keystone domains to nautobot tenant groups
and keystone projects to nautobot tenants.
This doesn't change any code or the actual service account that is being
used but it defines it in a way that can be consumed by external secrets
and sets the pathway for us to generate this in the future. We'd need
either an operator to action on the service account secrets to keystone
or some other way to keep them in sync.
Added an EventSource listener for keystone notifications. Added a Sensor
to trigger a workflow to be run when projects are created, updated or
deleted in keystone. Added a workflow to execute the keystone sync
script on each of those triggers.
@cardoe cardoe merged commit 0022519 into main Sep 10, 2024
21 checks passed
@cardoe cardoe deleted the keystone-event branch September 10, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants